package userimage;

import global.ProjectData;
import userimage.page.Page;

import javax.swing.*;

import java.awt.event.ComponentEvent;
import java.awt.event.ComponentListener;

import static global.ProjectData.*;

public class ToolsBar extends JPanel implements ComponentListener {

    Page pg = new Page(theme.toolsbar_width, 0, theme.toolbarframe_width, getHeight());

    public ToolsBar() {
        super();
        setBackground(ProjectData.theme.toolsbar);
        setLocation(0, 0);
        setSize(theme.toolsbar_width + theme.toolbarframe_width, getHeight());
        setLayout(null);
        addComponentListener(this);

        pg.setLocation(theme.toolsbar_width, 0);
        add(pg);
    }

    @Override
    public void componentResized(ComponentEvent componentEvent) {
        pg.setSize(theme.toolbarframe_width, getHeight());
    }


    @Override
    public void componentMoved(ComponentEvent componentEvent) {

    }

    @Override
    public void componentShown(ComponentEvent componentEvent) {

    }

    @Override
    public void componentHidden(ComponentEvent componentEvent) {

    }
}
